import java.util.*;

/**
 * @author chaird
 * @create 2021-11-03 19:34
 */
public class App {
  public static void main(String[] args) throws Exception {


    //SpringMVC
      //select MySQL

    PriorityQueue<Integer>  priorityQueue = new PriorityQueue<>(3);
    priorityQueue.add(1);
    System.out.println(priorityQueue.poll());


    ////select MySQL
    //告诉 ->  MQ  -> a,b,c,d









  }

  public static void addKeyOnce(Map<Character, Integer> target, Character key) {

    Integer integer = target.get(key);

    if (integer == null) {
      integer = 1;
    } else {
      integer = integer + 1;
    }
    target.put(key, integer);
  }

  public static void removeKeyOnce(Map<Character, Integer> target, Character key) {

    Integer integer = target.get(key);

    if (integer == null) {
      return;
    }

    integer = integer - 1;
    if (integer == 0) {
      target.remove(key);
    } else {
      target.put(key, integer);
    }
  }

  public static Boolean compareMap(Map<Character, Integer> target, Map<Character, Integer> soure) {

    Set<Map.Entry<Character, Integer>> entries = target.entrySet();

    for (Map.Entry<Character, Integer> entry : entries) {

      Character key = entry.getKey();
      Integer value = entry.getValue();

      Integer integer = soure.get(key);
      if (null == integer || integer < value) {
        return false;
      }
    }

    return true;
  }
}
